<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/26 0026
 * Time: 10:50
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Brand
 *
 * @property int $id
 * @property string $name
 * @property int $create_time
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand whereCreateTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand whereName($value)
 * @mixin \Eloquent
 * @property \Illuminate\Support\Carbon|null $update_time
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Brand whereUpdateTime($value)
 */
class Brand extends Model
{
    public $table = "brand";

    protected $guarded = [];

    const UPDATED_AT = 'update_time';
    const CREATED_AT = 'create_time';

    protected $dateFormat = 'U';

    protected $fillable = ['name'];

    public function getCreateTimeAttribute() {
        return date('Y-m-d H:i:s', $this->attributes['create_time']);
    }

    public function getUpdateTimeAttribute() {
        return date('Y-m-d H:i:s', $this->attributes['update_time']);
    }
}
